package 字符串.字符串排序;

import 字符串.单词查找树.单词查找树;

import java.util.Iterator;
import java.util.Queue;

/**
 * @author: yangwk
 * @date: 2023/4/10
 * @description:
 **/
public class 通过前缀树实现字符串排序 {

    public static void main(String[] args) {
        单词查找树.TriesST triesST = new 单词查找树.TriesST();
        String[] sort = new String[]{"AEE0", "AB08", "AES0", "CEH8"};
        for (String s : sort) {
            triesST.put(s, s);
        }
        Iterable keys = triesST.keys();
        Iterator iterator = keys.iterator();
        while (iterator!=null&& iterator.hasNext()) {
            System.out.println(iterator.next());
        }
    }
}
